#!/bin/bash
#############
#Date 2022/12/7
#mail it-arch
#############
echo "##########################################"
echo "change RHEL6.x to centos yum .          ##"
echo "Press Ctrl + C to cancel                ##"
echo "Any key to continue                     ##"
echo "##########################################"
read -n 1
/etc/init.d/iptables status >/dev/null 2>&1
rpm -qa|grep yum|xargs rpm -e --nodeps
rpm -e `rpm -qa|grep python-urlgrabber`
if [ -d /tools ];then
    cd /tools
else
    mkdir /tools && cd /tools
fi
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-73.el6.centos.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-urlgrabber-3.9.1-11.el6.noarch.rpm
rpm -ivh python* yum*
cd /etc/yum.repos.d/
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
sed -i 's/\$releasever/6/g' CentOS6-Base-163.repo
yum clean all 
yum makecache 
if [ $? -eq 0 ]
then
echo -e "\033[32m change RHEL6.x to centos yum is success! \033[0m"

